import logging
import qrcode
import base64
from io import BytesIO
from odoo import api, fields, models
from PIL import Image,ImageFont,ImageDraw
from odoo import tools, _
from odoo.exceptions import ValidationError, AccessError
from odoo.modules.module import get_module_resource
import json
_logger = logging.getLogger(__name__)

class InheritPosConfig(models.Model):
    _inherit = 'pos.order'
    # APP用户
    pos_user_id = fields.Many2one("pos.user", _("APP User"), readonly=True)

class InheritPosConfig(models.Model):
    _inherit = 'pos.order.line'

    # 接单时间
    order_taking_time = fields.Datetime(u'Order Time')
    # 完成时间
    order_finish_time = fields.Datetime(u'Complete Time')
    # 退单时间
    order_back_time = fields.Datetime(u'Return Time')
    # 烹饪时间、十五分钟、三十分钟、四十五分钟
    cooking_time = fields.Selection([(15, u"15 mins"), (30, u"30 mins"), (45, u"45 mins")], string=u"Cooking Time", )
    # 订单状态：未接单、已接单、已完成、已退单
    cooking_state = fields.Selection([(1, u"Missed Order"), (2, u"Order Received"), (3, u"Completed"), (4, u"Returned")], string=u"Order Status", default=1)
    price_unit = fields.Float(related='product_id.product_tmpl_id.list_price', string='Unit Price', digits=0)
    # 桌子
    table_number = fields.Many2one('restaurant.table', string = u'Table')
    # 归档
    c_show_active = fields.Boolean(u'Archive', default=True)


